1. Class No.24 Data Structures http://ecomputernotes.com
2.
3.
4.
5.
6.
7. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 is equal to sum of the frequencies of the two children nodes. http://ecomputernotes.com
8. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 There a number of ways to combine nodes. We have chosen just one such way. http://ecomputernotes.com
9. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 http://ecomputernotes.com
10. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 4 4 http://ecomputernotes.com
11. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 6 http://ecomputernotes.com
12. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 9 10 http://ecomputernotes.com
13. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 http://ecomputernotes.com
14. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 33 http://ecomputernotes.com
15.
16.
17.
18. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 33 1 0 http://ecomputernotes.com
19. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 33 1 0 1 0 1 0 http://ecomputernotes.com
20. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 33 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 http://ecomputernotes.com
21. Huffman Encoding v 1 y 1 SP 3 r 5 h 1 e 5 g 1 b 1 NL 1 s 2 n 2 i 2 d 2 t 3 a 3 2 2 2 5 4 4 4 8 6 14 9 19 10 33 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 http://ecomputernotes.com
22.
23. Huffman Encoding Original: traversing threaded binary trees Encoded: 001110000111001011100111010101101001011110011001111010100001001010100111110000101011000011011101111100111010110101110000 t r a v e http://ecomputernotes.com
24. Huffman Encoding Original: traversing threaded binary trees With 8 bits per character, length is 264. Encoded: 001110000111001011100111010101101001011110011001111010100001001010100111110000101011000011011101111100111010110101110000 Compressed into 122 bits, 54% reduction. http://ecomputernotes.com
26. Properties of Binary Tree Property: A binary tree with N internal nodes has N+1 external nodes. http://ecomputernotes.com
27. Properties of Binary Tree A binary tree with N internal nodes has N+1 external nodes. D F B C G A E F E internal nodes: 9 external nodes: 10 external node internal node http://ecomputernotes.com
28. Properties of Binary Tree Property: A binary tree with N internal nodes has 2N links: N-1 links to internal nodes and N+1 links to external nodes. http://ecomputernotes.com
29. Threaded Binary Tree Property: A binary tree with N internal nodes has 2N links: N-1 links to internal nodes and N+1 links to external nodes. D F B C G A E F E Internal links: 8 External links: 10 external link internal link http://ecomputernotes.com